package com.nulstudio.emotion.text.mapper;

import com.nulstudio.emotion.text.entity.NulRole;
import org.apache.ibatis.annotations.Mapper;

/**
 * Mapper for authority related operations.
 * @author nullsty
 * @since 2.0
 */
@Mapper
public interface AuthorityMapper {

    /**
     * Select a role by its name, with authorities associated with it.
     * @param name name of the role to select
     * @return an {@code NulRole} object, including information of the role and authorities associated with it.
     */
    NulRole getRoleByName(String name);

    /**
     * Select a role by its ID, with authorities associated with it.
     * @param id id of the role to select
     * @return an {@code NulRole} object, including information of the role and authorities associated with it.
     */
    NulRole getRoleById(int id);

}
